package com.ly.work.zk;

//饿汉
public class HungerSingle {

    //创建对象
    public static HungerSingle hungerSingle = new HungerSingle();

    private HungerSingle(){
        System.out.println(Thread.currentThread().getName()+"饿汉模式对象被创建");
    }

    //获取对象方法

    public static HungerSingle getHungerSingle() {
        return hungerSingle;
    }
}
